xxxxxxxxxx# Lab: Generative AI for Data Visualization# Lab: Generative AI for Data Visualization
**Estimated time needed:** 60 minutes
## Overview
In this lab, you will learn how to use generative AI to generate various visuals from the dataset. You will use the [Akkio](https://www.akkio.com/) and [Columns AI](https://columns.ai/) platforms to create multiple charts and graphs automatically using simple steps.
## Learning Objectives
After completing this lab, you will be able to:
* Sign in to [Akkio](https://www.akkio.com/) and [Columns AI](https://columns.ai/)
* Generate visuals
* Change the color theme in the chart
* Generate various charts
## Prerequisites
* Columns AI and Akkio account
* Basic understanding of exploratory data analysis (EDA)
>***Note: In Akkio and Columns AI, you can explore few features in the paid or trial version only***
## About Akkio
Akkio empowers users to harness the power of AI to automate repetitive tasks, including data analysis and visualization. With Akkio\'s intuitive platform, users can streamline their workflows and generate insights from their data effortlessly.
Using Akkio AI-driven capabilities, users can interact with their data through natural language queries, generating visualizations and actionable insights with ease. By automating these processes, Akkio enables users to focus on strategic decision-making and innovation.
>***Note: Akkio free trial version is limited to a duration of 15 days***
## About Columns AI
With Columns AI Natural Language Visualization feature, you can generate charts using descriptions written in plain language. This simplifies and enhances accessibility to data visualization.
Utilizing a natural language interface, users can inquire about their data and receive textual summaries, code snippets, or visual charts as outputs. Leveraging advanced AI models, Columns AI interprets user queries to discern intent and deliver appropriate responses.
>***Note: While signing up for Columns AI to access the free 7-day trial, users are required to add their bank account details. After the trial period, charges will apply. It is optional to proceed with this Columns AI exercise, and learners can decide if they wish to continue with the sign-up process.***
## Dataset
In this lab, you will work with two datasets: the Retail Sales Data dataset available on the Akkio platform and the Student Alcohol Consumption dataset `student-mat.csv` by UCI Machine Learning, which can be obtained from [Kaggle](https://www.kaggle.com/uciml/student-alcohol-consumption) for Columns AI.
The Retail Sales Data dataset contains information on retail sales, including various attributes such as Store ID, Employee Number, Area, Date, Sales, Marketing Spend, Electronics Sales, Home Sales, and Clothes Sales. This dataset appears to represent retail sales data, possibly from multiple stores in the same geographic area, over a period of time. Each entry in the dataset corresponds to a single sales transaction, including information about the store, employee, sales amount, and product categories.
| Field | Description |
|------|--------|
|Store ID| Identifier for the store where the sales were made.|
|Employee Number| Identifier for the employee involved in the sales transaction.|
|Area| Geographic area where the store is located.|
|Date| Date of the sales transaction.|
|Sales| Total sales amount for the transaction.|
|Marketing Spend| Amount spent on marketing activities for the transaction.|
|Electronics Sales| Sales amount specifically related to electronics products.|
|Home Sales| Sales amount specifically related to home products.|
|Clothes Sales| Sales amount specifically related to clothing products|
The Student Alcohol Consumption dataset is based on data collected from two secondary schools in Portugal, with students enrolled in mathematics and Portuguese courses. The dataset we are using is for the mathematics course. The number of mathematics students involved in the collection was 395. The data collected in locations such as Gabriel Pereira and Mousinho da Silveira includes several pertinence values. Examples of such data are records of demographic information, grades, and alcohol consumption.
| Field | Description |
|------|--------|
|school|GP/MS for the student\'s school|
|sex |M/F for gender|
|age|15-22 for the student\'s age|
|address|U/R for urban or rural, respectively|
|fam size|LE3/GT3 for less than or greater than three family members|
|Pstatus|T/A for living together or apart from parents, respectively|
|Medu |0 (none) / 1 (primary-4th grade) / 2 (5th - 9th grade) / 3 (secondary) / 4 (higher) for mother\'s education|
|Fedu |0 (none) / 1 (primary-4th grade) / 2 (5th - 9th grade) / 3 (secondary) / 4 (higher) for father\'s education|
|Mjob|\'teacher,\' \'health\' care related, civil \'services,\' \'at_home\' or \'other\' for the student\'s mother\'s job|
|Fjob |\'teacher,\' \'health\' care related, civil \'services,\' \'at_home\' or \'other\' for the student\'s father\'s job|
|reason|close to \'home,\' school \'reputation,\' \'course\' preference, or \'other\' for the choice of school|
|guardian | mother/father/other as the student\'s guardian|
|traveltime |1 (<15mins) / 2 (15 - 30 mins) / 3 (30 mins - 1 hr) / 4 (>1hr) for a time from home to school|
|studytime | 1 (<2hrs) / 2 (2 - 5hrs) / 3 (5 - 10hrs) / 4 (>10hrs) for weekly study time|
|failures | 1-3/4 for the number of class failures (if more than three, then record 4)|
|schoolsup | yes/no for extra educational support|
|famsup | yes/no for family educational support|
|paid | yes/no for extra paid classes for Math or Portuguese|
|activities | yes/no for extra-curricular activities|
|nursery | yes/no for whether attended nursery school|
|higher | yes/no for the desire to continue studies|
|internet | yes/no for internet access at home|
|romantic | yes/no for relationship status|
|famrel | 1-5 scale on quality of family relationships|
|freetime | 1-5 scale on how much free time after school|
|goout | 1-5 scale on how much student goes out with friends|
|Dalc | 1-5 scale on how much alcohol consumed on weekdays|
|Walc | 1-5 scale on how much alcohol consumed on the weekend|
|health | 1-5 scale on health condition|
|absences | 0-93 number of absences from school|
|G1 | 0-20 for the first-period grade|
|G2 | 0-20 for the second-period grade|
|G3 | 0-20 for the final grade|
<br>
## Task 1: Sign up and create an account on Akkio.
1. Sign up for Akkio.
2. Open the link, [Akkio](https://www.akkio.com/), and then click the \'Try for free\' button at the top right corner.

3. You will see the \'Sign up\' page. You may continue with an existing Google account or create a new one.

4. After creating your account, you will get a pop-up window as \'How are you planning to use Akkio?\', you can choose the relevant option and click \'Continue\'. You can skip the rest of the pop-up windows, as it\'s optional. Once the setup is completed, you will get a pop-up window as \'Enjoy Your Free Trial! 🎉\'.Click on \'Get Started\'.


5. The Launching page will occur; you have to select the \'Home\' button from the left top corner. It will launch on the home page.

## Task 1.1: Connecting to the dataset
1. From the home page, click \'Create New Project\' to create a new project from the existing dataset, the ***retail sales data*** dataset, one of the sample datasets provided by Akkio.

2. From the Prepare tab, select the \'Upload File\' option, which will redirect to the page to choose the dataset. Select the Retail sales data.csv dataset.


## Task 1.2: Generating visuals using Akkio
1. The selected dataset will appear on the page. Select the \'Explore\' tab to get an exploratory insight into the relationship between marketing spend and sales by generating a scatter plot. To do so, type \'Make a scatter plot of Marketing spend vs. sales\' in the \'Ask a question about your data\' prompt and click the \'Execute\' icon.


2. The scatter plot will be generated. You can get the details on the approach used to create this chart by clicking the \'Show Approach\'.


3. To generate a bar chart that shows the average sales by area, type \'Create a bar chart that shows the average sales by area\' in the \'Ask a question about your data\' prompt and click \'Execute\' icon. You can also download the charts by clicking the \'Download\' button.


4. To generate the correlation matrix on the data attributes as a heat map to understand their correlation, type \'Generate the Correlation matrix on the data attributes as heatmap\' in the \'Ask a question about your data\' prompt and click the \'Execute\' icon.


5. To generate box plots for verifying outliers, type \'Generate box plots to verify any outliers\' in the \'Ask a question about your data\' prompt and click the \'Execute\' icon.

6. To generate a histogram for all the attributes, type \'generate a histogram for all the attributes\' in the \'Ask a question about your data\' prompt and click the \'Execute\' icon. You can scroll up and down to see the histograms for all the attributes.

<br>
## Task 2 (Optional): Sign up and create an account on Columns AI
1. Sign up for Columns AI.
2. Open the link [Columns AI](https://columns.ai/) and then click the \'Login\' button at the top right corner.

3. You will see the \'Sign in or Sign up\' page. You may continue with an existing Google or Slack account or create a new one by signing up.
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/18vjjOIkFI2EmPL77MBvmQ/2.jpg" alt="2.jpg" width="700" height="700">
4. After creating your account, you may launch to the main page.

## Task 2.1: Connecting to the dataset
1. Click the \'Story\' that is shown in the top right corner. A pop-up window will appear as \'How do you provide data\'.

2. Select the \'Saved Data\' option from the pop-up window. A pop-up window as \'Load a Dataset\' will appear.
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/goAC_XrGU9tcxURpB-x6Hg/5.jpg" alt="5.jpg" width="700" height="700">
3. Select the \'Connect new data\' option from the pop-up window.
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/wwFWJYTzccV2AlwLB4xCvQ/6.jpg" alt="6.jpg" width="700" height="200">
4. Select the \'Upload a file (csv)\' from the Connect your data window. Choose the \'student-mat.csv\' file from your computer.
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/89Z4FfM--eJ-X6hznJ-4ag/7.jpg" alt="7.jpg" width="400" height="400">

5. Once the CSV is added, click \'Upload\' from the \'Connect your data\' window.
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/2HbaeT5ny4p3RyUr14gNoQ/9.jpg" alt="9.jpg" width="400" height="400">
6. Once you have uploaded, you can view the data. Then, click on \'Save\'.

7. Once the data is uploaded, you can explore the data by clicking the \'Explore\' option from the Data & Query section.

8. Select the \'Column Histogram\' drop-down and choose any of the columns to view the visualization of autogenerated charts and statistics from the data.
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/f7F-1n9034PtkpZgjcFFLA/12.jpg" alt="12.jpg" width="900" height="500">
## Task 2.2: Generating Visuals using Columns AI
1. To find the total number of male and female students in the dataset. Type \"total number of male and female students in the dataset\" in the \'Question\' prompt and click the \'Search\' button. A bar chart will appear with the sorted result. You can click \'Apply\' to view and use it for the dataset.
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/FjdvUh29OI8diDQlYOtz1w/13.jpg" alt="13.jpg" width="800" height="400">
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/ZFAmpg_9uayhKzWbvl9jMw/14.jpg" alt="14.jpg" width="700" height="400">
2. You can use the \'wizard\' option from the \'Data & Query\' section to generate a chart. You can generate a pie chart representing the average weekly alcohol consumption, identified by the Walc value for each gender. Click \'Make\'.

3. Click \'Generate\' and then select Smart Title; a title is generated for the chart.
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/ISUO7ygyzBh2y8EurDldXQ/16.jpg" alt="16.jpg" width="700" height="450">
4. Click \'Generate\' and then select \'Summarize Insight\' to generate insight on this chart. You can edit the annotated insight if you want to.
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/b3qlN6aorqUiwWzzpCqa6A/17.jpg" alt="17.jpg" width="700" height="450">

5. You can also change the chart appearance by clicking the \'General Setting\' icon and choosing any \'Theme\'.

6. Once done with the customizations, you can download it either as a PNG or SVG image file or as a CSV or JSON data file by clicking the download icon on the top right corner, choosing the required file type from the list, and selecting the \'Download\' option.
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/9ahHqkfaRdYT87P0o7LgvQ/20.jpg" alt="20.jpg" width="900" height="500">
## Conclusion
In this lab, you learned how to use the Columns AI and Akkio platforms to generate various visuals from datasets. You connected to datasets, generated visuals using natural language prompts, modified chart color themes, and created different types of charts to analyze the data effectively. By leveraging these generative AI tools, you can streamline your data analysis process and gain insights quickly and efficiently.
#### Author:
[Sathya Priya]()
<footer>
<img align="left" src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/nRmYgyM2KjRIIiG16R7ikg/ibmsn-footer-blue.png" alt="cognitiveclass.ai logo">
</footer>
<!-- ## Change Log
| Date (YYYY-MM-DD) | Version | Changed By | Change Description |
|-------------------|---------|---------------|---------------------------------------------------------------------------------------------------------------------|
| 2024-16-05 | 0.1 | Sathya Priya | Added the first iteration of the lab |
| 2024-06-06 | 0.2 | Pornima More | QC pass with edits |
-->
Estimated time needed: 60 minutes
In this lab, you will learn how to use generative AI to generate various visuals from the dataset. You will use the Akkio and Columns AI platforms to create multiple charts and graphs automatically using simple steps.
After completing this lab, you will be able to:
Note: In Akkio and Columns AI, you can explore few features in the paid or trial version only
Akkio empowers users to harness the power of AI to automate repetitive tasks, including data analysis and visualization. With Akkio's intuitive platform, users can streamline their workflows and generate insights from their data effortlessly.
Using Akkio AI-driven capabilities, users can interact with their data through natural language queries, generating visualizations and actionable insights with ease. By automating these processes, Akkio enables users to focus on strategic decision-making and innovation.
Note: Akkio free trial version is limited to a duration of 15 days
With Columns AI Natural Language Visualization feature, you can generate charts using descriptions written in plain language. This simplifies and enhances accessibility to data visualization.
Utilizing a natural language interface, users can inquire about their data and receive textual summaries, code snippets, or visual charts as outputs. Leveraging advanced AI models, Columns AI interprets user queries to discern intent and deliver appropriate responses.
Note: While signing up for Columns AI to access the free 7-day trial, users are required to add their bank account details. After the trial period, charges will apply. It is optional to proceed with this Columns AI exercise, and learners can decide if they wish to continue with the sign-up process.
In this lab, you will work with two datasets: the Retail Sales Data dataset available on the Akkio platform and the Student Alcohol Consumption dataset student-mat.csv by UCI Machine Learning, which can be obtained from Kaggle for Columns AI.
The Retail Sales Data dataset contains information on retail sales, including various attributes such as Store ID, Employee Number, Area, Date, Sales, Marketing Spend, Electronics Sales, Home Sales, and Clothes Sales. This dataset appears to represent retail sales data, possibly from multiple stores in the same geographic area, over a period of time. Each entry in the dataset corresponds to a single sales transaction, including information about the store, employee, sales amount, and product categories.
| Field | Description |
|---|---|
| Store ID | Identifier for the store where the sales were made. |
| Employee Number | Identifier for the employee involved in the sales transaction. |
| Area | Geographic area where the store is located. |
| Date | Date of the sales transaction. |
| Sales | Total sales amount for the transaction. |
| Marketing Spend | Amount spent on marketing activities for the transaction. |
| Electronics Sales | Sales amount specifically related to electronics products. |
| Home Sales | Sales amount specifically related to home products. |
| Clothes Sales | Sales amount specifically related to clothing products |
The Student Alcohol Consumption dataset is based on data collected from two secondary schools in Portugal, with students enrolled in mathematics and Portuguese courses. The dataset we are using is for the mathematics course. The number of mathematics students involved in the collection was 395. The data collected in locations such as Gabriel Pereira and Mousinho da Silveira includes several pertinence values. Examples of such data are records of demographic information, grades, and alcohol consumption.
| Field | Description |
|---|---|
| school | GP/MS for the student's school |
| sex | M/F for gender |
| age | 15-22 for the student's age |
| address | U/R for urban or rural, respectively |
| fam size | LE3/GT3 for less than or greater than three family members |
| Pstatus | T/A for living together or apart from parents, respectively |
| Medu | 0 (none) / 1 (primary-4th grade) / 2 (5th - 9th grade) / 3 (secondary) / 4 (higher) for mother's education |
| Fedu | 0 (none) / 1 (primary-4th grade) / 2 (5th - 9th grade) / 3 (secondary) / 4 (higher) for father's education |
| Mjob | 'teacher,' 'health' care related, civil 'services,' 'at_home' or 'other' for the student's mother's job |
| Fjob | 'teacher,' 'health' care related, civil 'services,' 'at_home' or 'other' for the student's father's job |
| reason | close to 'home,' school 'reputation,' 'course' preference, or 'other' for the choice of school |
| guardian | mother/father/other as the student's guardian |
| traveltime | 1 (<15mins) / 2 (15 - 30 mins) / 3 (30 mins - 1 hr) / 4 (>1hr) for a time from home to school |
| studytime | 1 (<2hrs) / 2 (2 - 5hrs) / 3 (5 - 10hrs) / 4 (>10hrs) for weekly study time |
| failures | 1-3/4 for the number of class failures (if more than three, then record 4) |
| schoolsup | yes/no for extra educational support |
| famsup | yes/no for family educational support |
| paid | yes/no for extra paid classes for Math or Portuguese |
| activities | yes/no for extra-curricular activities |
| nursery | yes/no for whether attended nursery school |
| higher | yes/no for the desire to continue studies |
| internet | yes/no for internet access at home |
| romantic | yes/no for relationship status |
| famrel | 1-5 scale on quality of family relationships |
| freetime | 1-5 scale on how much free time after school |
| goout | 1-5 scale on how much student goes out with friends |
| Dalc | 1-5 scale on how much alcohol consumed on weekdays |
| Walc | 1-5 scale on how much alcohol consumed on the weekend |
| health | 1-5 scale on health condition |
| absences | 0-93 number of absences from school |
| G1 | 0-20 for the first-period grade |
| G2 | 0-20 for the second-period grade |
| G3 | 0-20 for the final grade |
Sign up for Akkio.
Open the link, Akkio, and then click the 'Try for free' button at the top right corner.


















Sign up for Columns AI.
Open the link Columns AI and then click the 'Login' button at the top right corner.









In this lab, you learned how to use the Columns AI and Akkio platforms to generate various visuals from datasets. You connected to datasets, generated visuals using natural language prompts, modified chart color themes, and created different types of charts to analyze the data effectively. By leveraging these generative AI tools, you can streamline your data analysis process and gain insights quickly and efficiently.